package com.yantong.utils;


import com.yantong.constant.StringConstans;

/**
 * redis key
 */
public class WxRedisKeyHelper {
    //微信相关的RedisKey
    public static String WX_GZH_ACCESSTOKEN = "wx_gzh_accesstoken";
    //JSAPI的Ticket
    public static final String JSAPI_TICKET = "jsapiTicket";
    //微信卡券Ticket
    public static final String CARD_API_TICKET = "cardApiTicket";

    public static String getGzhAccessTokenKey(Long centerId) {
        String accessTokenKey = WX_GZH_ACCESSTOKEN;
        if (null != centerId) {
            accessTokenKey = accessTokenKey + StringConstans.STR_SIGN_UNDER_LINE + centerId;
        }
        return accessTokenKey;
    }

    public static String getJsapiTicketKey(Long centerId) {
        String jsapiTicketKey = JSAPI_TICKET;
        if (null != centerId) {
            jsapiTicketKey = jsapiTicketKey + StringConstans.STR_SIGN_UNDER_LINE + centerId;
        }
        return jsapiTicketKey;
    }

    public static String getCardApiTicketKey(Long centerId) {
        String cardApiTicketKey = CARD_API_TICKET;
        if (null != centerId) {
            cardApiTicketKey = cardApiTicketKey + StringConstans.STR_SIGN_UNDER_LINE + centerId;
        }
        return cardApiTicketKey;
    }

}
